package com.crpc.config;

import com.crpc.common.crpcEnum.CompressorEnums;
import com.crpc.common.crpcEnum.LoadBalancerEnums;
import com.crpc.common.crpcEnum.SerializerEnums;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @Author taochui
 * @Description: 获取配置文件属性，如果没有则为默认值
 * @Date： 2022/12/13 1:56
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "spring.rpc")
public class CrpcProperties {

    @Value("${nettyPort:6913}")
    private String nettyPort;

    @Value("${providerHost:127.0.0.1}")
    private String providerHost;

    @Value("${consumerHost:127.0.0.1}")
    private String consumerHost;

    @Value("${serviceClassPath:/}")
    private String serviceClassPath;
    @Value("${crpcName:default-appName-crpc}")
    private String crpcName;

    @Value("${compressorType:GZIP}")
    private CompressorEnums compressorType;

    @Value("${serializerType:HESSIAN}")
    private SerializerEnums serializerType;

    @Value("${loadBalancerType:RoundRobin}")
    private LoadBalancerEnums loadBalancerType;

}

